package com.wfy.modules.sys.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.wfy.modules.sys.entity.Role;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: wangxindong
 * @date: 2018/2/10-20:43
 */
public class RoleVo implements Serializable {

    // ================================================================
    // Constants
    // ================================================================

    private static final long serialVersionUID = 1L;

    // ================================================================
    // Fields
    // ================================================================

    private String id;
    private String name;
    private String enname;
    private String roleType;
    private String dataScope;
    private String useable;
    private String officeId;
    private String offieName;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;
    private String createBy;

    // ================================================================
    // Constructors
    // ================================================================

    // ================================================================
    // Methods from/for super Interfaces or SuperClass
    // ================================================================

    // ================================================================
    // Public or Protected Methods
    // ================================================================

    public RoleVo build(Role role) {
        BeanUtils.copyProperties(role, this);
        return this;
    }

    public List<RoleVo> build(List<Role> roles) {
        List<RoleVo> result = null;
        if (null != roles && !roles.isEmpty()) {
            result = new ArrayList<>(roles.size());
            for (Role r : roles) {
                result.add(build(r));
            }
        }
        return result;
    }


    // ================================================================
    // Getter & Setter
    // ================================================================

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getEnname() {
        return enname;
    }

    public void setEnname(String enname) {
        this.enname = enname;
    }

    public String getRoleType() {
        return roleType;
    }

    public void setRoleType(String roleType) {
        this.roleType = roleType;
    }

    public String getDataScope() {
        return dataScope;
    }

    public void setDataScope(String dataScope) {
        this.dataScope = dataScope;
    }

    public String getUseable() {
        return useable;
    }

    public void setUseable(String useable) {
        this.useable = useable;
    }

    public String getOfficeId() {
        return officeId;
    }

    public void setOfficeId(String officeId) {
        this.officeId = officeId;
    }

    public String getOffieName() {
        return offieName;
    }

    public void setOffieName(String offieName) {
        this.offieName = offieName;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

// ================================================================
    // Private Methods
    // ================================================================


    // ================================================================
    // Inner or Anonymous Class
    // ================================================================

    // ================================================================
    // Test Methods
    // ================================================================

}
